<%@ page language="java" import="java.util.*" pageEncoding="utf8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>Index page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script src="/jlitetest/js/echarts.min.js"></script>
</head>

<body>
	<div id="charts" style="width: 1000px;height:600px;"></div>
	<script type="text/javascript">
		var prftLst = eval('${data}');
		//alert(prftLst);console.log(prftLst);

 		//var stLst = '[{"val":"5005.11","st_id":"null","unm":"Allen","pwd":"null"},{"val":"4004.22","st_id":"null","unm":"Sam","pwd":"null"},{"val":"7015.55","st_id":"null","unm":"Zack","pwd":"null"}]';
		//stLst = JSON.parse(stLst);
		var valLst = [];
		var timeLst = [];
		for(var i=0; i<prftLst.length; i++){
			valLst[i] = prftLst[i].val;
			timeLst[i] = prftLst[i].time;
		}
		var myChart = echarts.init(document.getElementById('charts'));
		var option = {
			title : {
				text : 'ECharts demo'
			},
			tooltip : {},
			legend : {
				data : [ 'time' ]
			},
			xAxis : {
				data : timeLst
			},
			yAxis : {},
			series : [ {
				name : 'profit',
				type : 'bar',
				data : valLst
			} ]
		};

		// 使用刚指定的配置项和数据显示图表。
		myChart.setOption(option);
	</script>
</body>
</html>
